<?php
//
// Blocks/Blokai
//
function style_blockHide($title, $info, $hide=false, $label=false, $id=false) {
	if ($id == false) $id = "a".uniqid();
	$retrun = "\n<div class=\"title\" onclick=\"rodyk('".$id."');if (readCookie('".$id."') == 1) {createCookie('".$id."',0,1);} else {createCookie('".$id."',1,1);}\" style=\"cursor: pointer;\"><font color=\"red\">▲</font> ".ucfirst($title)." <font color=\"red\">▼</font></div>\n";
	if($hide) $style = " style=\"display: none\""; else $style = "";
	
	if ($label)	$retrun .= "<div class=\"vidus\" id=\"".$id."\"$style><fieldset>\n<legend>".$label."</legend>\n".$info."</fieldset></div>\n";
	else		$retrun .= "<div class=\"vidus\" id=\"".$id."\"$style>".$info."</div>\n";

	$retrun .= "<script type=\"text/javascript\">if (readCookie('".$id."') == 0) { document.getElementById('".$id."').style.display = 'none'; }</script>";
	return $retrun;
}

function style_block($title,$info,$label="") {//lentele
	$retrun = "\n<div class=\"title\"><div style=\"padding-top:2px;\">".ucfirst($title)."</div></div>\n";
	if($label == "") $retrun .= "<div class=\"vidus\">$info</div>\n";
	else	$retrun .= "<div class=\"vidus\"><fieldset>\n<legend>$label</legend>\n$info\n</fieldset></div>\n";
	return $retrun;
}

//
// Content/Turinys
//
function style_box($pavadinimas, $info) {
	return "<br /><div style=\"border:1px solid pink; padding:2px; background-color: white;\"><div style=\"background-color: #eaf4f9; background-image: url(templates/default/images/block_vidus_fonas.gif);background-repeat: repeat-x; padding-left: 10px; padding-right: 10px; padding-bottom: 10px; height:100%; border: 2px solid #addbf1;\">
<div style=\"border-bottom: 1px solid #659aba; text-align:center; font-size:13px; font-weight: bold; margin-bottom:5px;\">".$pavadinimas."</div>".$info."</div></div><br />";
}
function style_inlineBox($pavadinimas, $info) {
	return "<div class=\"box\"><div class=\"box_border\">".$pavadinimas."</div><br />".$info."</div>\n";
}
//
// Footer/Apačia
//
function style_copyright_start() {
	return "<div class=\"comment\" style=\"background-color:white;\">";
}
function style_copyright_end() {
	return "</div>";
}

//
// Errors & Succesfuls msg/Klaidų ir sėkmingų pakeitimų pranešimų lentelės
//
function style_klaida($title, $info, $label=false) {
	global $conf, $db;

	if ($conf['Palaikymas'] != 1)
		$db->uzklausa("INSERT INTO `logai` SET `action`=".$db->fix($pavadinimas).": Tekstas: ".$tekstas." Puslapis: ".$_SERVER['QUERY_STRING'].", `time`='NOW()', `ip`='INET_ATON(".IP.")'");

	if ($label) return "\n<div class=\"title\" style=\"border-color:black;background:red;color:white\">".ucfirst($title)."!</div>\n<div class=\"vidus\" style=\"border-color:black;background:yellow\"><fieldset>\n<legend>$label</legend>\n <img src=\"images/icons/emblem-important.png\" align=\"left\" hspace=\"10\" alt=\"Klaida\"/>$info</fieldset></div></div>";
	else		return "\n<div class=\"title\" style=\"border-color:black;background:red;color:white\">".ucfirst($title)."!</div>\n<div class=\"vidus\" style=\"border-color:black;background:yellow\"><img src=\"images/icons/emblem-important.png\" align=\"left\" hspace=\"10\" alt=\"Klaida\"/>$info</div>";
	

}
function style_msg($pavadinimas, $tekstas, $label=false) {
	if ($label)	return "\n<div class=\"title\" style=\"border-color:black;background:green;color:white\">".ucfirst($pavadinimas)."</div>\n<div class=\"vidus\" style=\"border-color:black;background:#CCFFCC\"><fieldset>\n<legend>$label</legend>\n<img src=\"images/icons/tick.png\" align=\"left\" hspace=\"10\" alt=\"Klaida\"/>$tekstas</fieldset></div>\n";
	else		return "\n<div class=\"title\" style=\"border-color:black;background:green;color:white\">".ucfirst($pavadinimas)."</div>\n<div class=\"vidus\" style=\"border-color:black;background:#CCFFCC\"><img src=\"images/icons/tick.png\" align=\"left\" hspace=\"10\" alt=\"Klaida\"/>$tekstas</div>\n";
}


/*
function th_meniu($array, $start='<ul>', $end='</ul>') {
	$return = $start."\n";
	foreach($array as $key => $val){
		if (is_array($val)) {
			$return .= "\t<li>$key\n".
					"\t<ul>\n\t".
					"\t".th_meniu($val).
					"\t</ul></li>\n";
		} else {
			$return .= "\t<li><a href='$val'>$key</a></li>\n";
		}
	}
	return $return."\n".$end;
}

function style_ofunc() {
	echo "
		<table width=\"100%\" border=\"0\">
			<tr>
				<td><div class=\"title\">Masyvas</div></td>
				<td><div class=\"title\">Paaiškinimas</div></td>
			</tr>
			<tr>
		 ";
}
function style_cfunc() {
	echo "</table>";
*/
?>
